package edu.mtu.citizenscience.mushroommapper.activity.main;

import com.openswimsoftware.orm.model.list.ModelArrayList;
import com.openswimsoftware.orm.model.list.ModelList;

import android.os.Bundle;

import edu.mtu.citizenscience.mushroommapper.MMListActivity;
import edu.mtu.citizenscience.mushroommapper.activity.R;
import edu.mtu.citizenscience.mushroommapper.activity.main.fieldguide.FieldGuideListAdapter;
import edu.mtu.citizenscience.mushroommapper.model.ModelGuideMushroom;
/**
 * @author Corbin Uselton <corbinu@cwuselto@mtu.edu>
 * @copyright (c) 2012 MichiganTech <http://www.mtu.edu>
 * @since 1.0
 * 
 * Field Guide Activity shows the field guide mushroom list
 * to make it easy to identify common mushrooms
 */
public class FieldGuideActivity extends MMListActivity {

	/**
	 * Field Guide Activity creation handler
	 * 
	 * @param   savedInstanceState - Bundle - Bundle with launch info
	 * @return	void
	 */
	@Override
	public void onCreate(Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		
		this.setContentView(R.layout.field_guide_activity);
     		
		// Load a model list with all the guide mushrooms
        ModelList<ModelGuideMushroom> mushrooms = new ModelArrayList<ModelGuideMushroom>(this, ModelGuideMushroom.class).find();
		
        // add model list the the list adapter for this activity
		this.setListAdapter(new FieldGuideListAdapter(this.aq, mushrooms));
	}

}
